#pragma once
#include<iostream>

using namespace std;
#include<assert.h>

class Date
{
public:
	Date(int year = 1900, int month = 1, int day = 1);

	void Print();

	int GetMonthDay(int _year, int _month)
	{
		assert(_month >= 1 && _month <= 13);

		static int MonthDayArray[13] = { -1,31,28,31,30,31,30,31,31,30,31,30,31 };
		if (_month == 2 && ((_year % 4 == 0 && _year % 100 != 0) || _year % 400 == 0))
		{
			return 29;
		}
		return MonthDayArray[_month];
	}

	Date& operator+=(int day);
	Date operator+(int day);

	Date& operator-=(int day);
	Date operator-(int day);

private:
	int _year;
	int _month;
	int _day;
};